<template>
  <div>
    <div class="clearfix">
      <Description
        title="房屋信息"
        :collapseOptions="{ canExpand: false, helpMessage: '房屋信息' }"
        :column="1"
        :data="tableData"
        :schema="tableSchema"
      />
    </div>
  </div>
</template>
<script>
  import { Description } from '/@/components/Description/index';
  import { inject } from 'vue';

  export default {
    name: 'BoxPopup',
    components: {
      Description,
    },
    props: {
      obj: {
        type: Object,
      },
      tableSchema: {
        type: Array,
      },
    },
    computed: {
      tableData: function () {
        var gf = this.obj;
        if (gf) {
          return gf;
        }

        return {};
      },
      // tableSchema: function () {
      //   var gf = this.obj;
      //   if (gf) {
      //     var tb = [];
      //     for (let key in gf) {
      //       if (!this.complexityValueType(gf[key])) {
      //         tb.push({
      //           field: key,
      //           label: key,
      //           contentMinWidth: 500,
      //         });
      //       }
      //     }

      //     return tb;
      //   }

      //   return [];
      // },
    },
    methods: {
      complexityValueType(v) {
        if (typeof v == 'object') {
          return true;
        }

        return false;
      },
      onClickOk() {
        var gf = this.obj;
        const theMitt = inject('theMitt');
        theMitt.emit('clickok', gf);
      },
    },
  };
</script>
